//
//  PicViewController.m
//  Journey
//
//  Created by dllo on 16/5/16.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "PicViewController.h"
#import "UMSocialSnsPlatformManager.h"
@interface PicViewController ()

@end

@implementation PicViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.navigationItem.title = @"专题";
     UIWebView *webView = [[UIWebView alloc] initWithFrame:self.view.frame];
    [webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@",self.slideString]]]];
    NSLog(@"==%@",self.slideString);
     [self.view addSubview:webView];
    self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"return"] style:UIBarButtonItemStylePlain target:self action:@selector(leftButtonAction)];
    
  //  self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"Share"] style:UIBarButtonItemStylePlain target:self action:@selector(rightButtonAction)];
    
     //Do any additional setup after loading the view.
}

-(void)leftButtonAction{
    [self  dismissViewControllerAnimated:YES completion:^{
    }];
}


-(void)rightButtonAction{
    /**
     根据平台名，返回平台对象
     
     @param platformName sns平台名
     
     @return UMSocialSnsPlatform 平台对象
     */
    
    UMSocialSnsPlatform *snsPlatform = [UMSocialSnsPlatformManager getSocialPlatformWithName:UMShareToSina];
    /**
     Sns平台类，用`platformName`作为标识，指定显示名称、显示的图片，点击之后的响应。
     */
    snsPlatform.displayName = @"新浪";
    snsPlatform.loginName = @"网易";
    
    UMSocialSnsPlatform *snsPlatform2 = [UMSocialSnsPlatformManager getSocialPlatformWithName:UMShareToTencent];
    snsPlatform2.displayName = @"腾讯微博";
    
    //分享第二步
    [UMSocialSnsService presentSnsIconSheetView:self
 appKey:@"558936d367e58eb81b001298"  shareText:@"你要分享的文字"
  shareImage:[UIImage imageNamed:@"Icon-29.png"]
 shareToSnsNames:[NSArray arrayWithObjects:UMShareToSina,UMShareToTencent,UMShareToRenren,nil] delegate:self];
    
}


@end
